<?php 
if(!isset($_SESSION)) 
{ 
session_start(); 
} 

if (isset($_REQUEST['rows_per_page']) and isset($_REQUEST['number_of_page'])) {
	
	$pageNum = $_REQUEST['pageNum'];
	$rows_per_page = $_REQUEST['rows_per_page'];
	$number_of_page = $_REQUEST['number_of_page'];
	
	if ($number_of_page >1){?> 
				
				<tr>
							<td class="rf-dt-ftr-c" style="text-align: center;padding:1px 0px;border:0 !important " colspan="7">
									<span style="padding:1px; display: inline-block;">
																
										<?php if ( $number_of_page > 1 ) 
										{ 
											if ($pageNum==1)
												$p=2;
											else if ($pageNum==$number_of_page)
												$p=$number_of_page-1;
											else $p=$pageNum;
											if($pageNum!=1){?>
												<a onclick="OnPagging(<?=1?>,<?=$rows_per_page?>,<?=$number_of_page?>)"><span class='button_next'><?php echo "<<<";?></span> </a>
												<a onclick="OnPagging(<?=($pageNum-1)?>,<?=$rows_per_page?>,<?=$number_of_page?>)"><span class='button_next'><?php echo "<<";?></span> </a>
											<?php  }
											else{
												echo "<span class='button_next'><<<</span> "; 
												echo "<span class='button_next'><<</span> ";
											}
											for ( $i = $p-1; $i <= $p+1; $i++ ) {	
													if ($i<=$number_of_page && $i>0)
														if ($i==$pageNum){
															echo "<span class='button_next' style='color: blue;'><b>".$i."</b></span>"; 
														}else{
														?>
															<a onclick="OnPagging(<?=$i?>,<?=$rows_per_page?>,<?=$number_of_page?>)"><span class="button_next">
															<?php echo $i;?>
															</span> </a>
															<?php 
														}
													?>
												
											<?php 
													}
												
												if($pageNum!=$number_of_page){ ?>
													<a onclick="OnPagging(<?=$pageNum+1?>,<?=$rows_per_page?>,<?=$number_of_page?>)"><span class='button_next'><?php echo ">>";?></span> </a>
													<a onclick="OnPagging(<?=$number_of_page?>,<?=$rows_per_page?>,<?=$number_of_page?>)"><span class='button_next'><?php echo ">>>";?></span> </a>
												<?php }
												else{
													echo "<span class='button_next'>>></span> ";
													echo "<span class='button_next'>>>></span> ";
												}
											}
											
											?>
									</span>
		               			 </td>
							</tr> 
						
						
				<?php }
	
	
	
}
?>  